<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>书籍-All</title>
    <link rel="stylesheet" href="./ast/iframe.css">
    <style>
    </style>
</head>
<body>
<div id="sidebar">

<div class="menu-item">
        <div class="submenu2">
            <a href="allbook.php">书籍-大全</a>
        </div>
    </div>
    <div class="menu-item">
        <div class="submenu2">
            <a href="tlsq.php">讨论-社区</a>
        </div>
    </div>

    <div class="menu-item">
        <div class="submenu2">
            <a onclick="goawy()">个人-中心</a>
        </div>
    </div>
    


</div>
<div id="main-content">
    <iframe id="content-iframe" src="allbook.php"></iframe>
</div>
    <script>
       document.querySelectorAll('.menu-item .menu-title').forEach(title => {
        title.addEventListener('click', function() {
            const parentItem = this.closest('.menu-item');
            parentItem.classList.toggle('open');
        });
    });
    document.querySelectorAll('.menu-item .submenu a').forEach(link => {
        link.addEventListener('click', function(event) {
            event.preventDefault(); 
            const src = this.getAttribute('href');
            document.getElementById('content-iframe').src = src;
            document.querySelectorAll('.menu-item').forEach(item => {
                item.classList.remove('open');
            });
        });
    });
    document.querySelectorAll('.menu-item .submenu2 a').forEach(link => {
        link.addEventListener('click', function(event) {
            event.preventDefault(); 
            const src = this.getAttribute('href');
            document.getElementById('content-iframe').src = src;
            document.querySelectorAll('.menu-item').forEach(item => {
                item.classList.remove('open');
            });
        });
    });
    function goawy() {
        location.href="/center-person";
    }
    
    </script>
    <script>
    

    </script>
</body>
</html>